# -*- coding:utf-8 -*-
for i in range(1,10000):
    n=str(i)
    l=int(len(n)/2)
    for j in range(1,l+1):
        if n[j-1] != n[-j]:break
        if j == l:print(i)
